package com.coco.service.impl;

import com.coco.dao.NaviMapper;
import com.coco.model.NaviInfo;
import com.coco.model.NaviInfoCondition;
import com.coco.service.NaviService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * @author GHOSTLaycoo
 * @date 2020/4/7 0007 - 上午 9:24
 */
@Service
public class NaviServiceImpl implements NaviService{

    @Autowired
    private NaviMapper naviMapper;

    @Override
    public int save(NaviInfo naviInfo) {
        String uuid = UUID.randomUUID().toString();
        naviInfo.setId(uuid);
        naviInfo.setCreateTime(new Date());
        return naviMapper.save(naviInfo);
    }

    @Override
    public int delete(String id) {
        return naviMapper.delete(id);
    }

    @Override
    public int update(NaviInfo naviInfo) {
        return naviMapper.update(naviInfo);
    }

    @Override
    public List<NaviInfo> getNaviByCondition(NaviInfoCondition naviInfoCondition) {
        return naviMapper.getNaviByCondition(naviInfoCondition);
    }

    @Override
    public List<NaviInfo> getNavis() {
        return naviMapper.getNavis();
    }
}
